<template>
	<view class="loding" v-if="loding">
		<loading></loading>
	</view>
	<view v-else>
		<view
			style="height: 35vh;display: flex;justify-content: start;align-items: flex-end; margin-bottom: 30rpx;padding: 0 100rpx;">
			<image src="../../static/程序员.png" mode="aspectFill" style="width: 120rpx;height: 120rpx;"></image>

			<view style="display: flex;flex-direction: column;color:#387ece;font-weight: bold;">

				<view style="font-size: 36rpx;margin-bottom: 12rpx;">
					{{userInfo.username}}
				</view>
				<view style="font-size: 24rpx;">{{userInfo.introduce}}</view>
			</view>
		</view>
		<view class="home">
			<view class="item" @click="toMy()">
				<view class="iconfont icon-gangwei">
				</view>
				<view class="title">
					个人简历
				</view>
			</view>
			<view class="item" @click="toWork()">
				<view class="iconfont icon-gongzuojingyan">
				</view>
				<view class="title">
					工作经历
				</view>
			</view>
			<view class="item" @click="toProject()">
				<view class="iconfont icon-xiangmu2">
				</view>
				<view class="title">
					项目经验
				</view>
			</view>

			<view class="item" @click="toSkill()">
				<view class="iconfont icon-zhuanye2">
				</view>
				<view class="title">
					职业技能
				</view>
			</view>
		</view>
	</view>

</template>

<script>
	import loading from '../../components/loading.vue'
	export default {
		data() {
			return {
				userInfo: {
					_id: null,
					username: null,
					introduce: null
				},
				loding: true
			}
		},
		components: {
			loading
		},
		methods: {
			onLoad() {
				uniCloud.callFunction({
					name: "userInfo",
					data: {

					},
					success: (res) => {
						this.loding = false
						console.log(res.result.data[0]);
						this.userInfo = res.result.data[0]
					},
					fail: (err) => {
						console.log(err);
					}

				});
	},
	toMy() {
		wx.getUserInfo({
					success: function(res) {
						console.log('getUserInfo：：：：：：', res)
						let iv = res.iv; //加密值
						let encryptedData = res.encryptedData; //包括敏感数据在内的完整用户信息的加密数据
						let referrer = '' // 推荐人
						let referrer_storge = wx.getStorageSync('referrer');
						if (referrer_storge) {
							referrer = referrer_storge;
						}
						
			}
		})
			// uni.navigateTo({
			// 	url: '../home/home'
			// })
		},
		toWork() {
			uni.navigateTo({
				url: "../work-experience/work-experience"
			})
		},
		toCreate() {
			uni.navigateTo({
				url: '../basic-info/basic-info'
			})
		},
		toProject() {
			uni.navigateTo({
				url: '../project/project'
			})
		},
		toSkill() {
			uni.navigateTo({
				url: '../skill/skill'
			})
		}
	}
	}
</script>

<style>
	.content {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
	}


	.loding {
		display: flex;
		justify-content: center;
		align-items: center;
		height: 100vh;
	}

	.home {
		display: flex;
		justify-content: center;
		align-items: center;
		padding: 0 80rpx;
		flex-wrap: wrap;
		align-content: center;
	}

	.home .item {
		margin: 10rpx 15rpx;
		width: 260rpx;
		height: 160rpx;
		border-radius: 21rpx;
		background-image: url('https://products.ls.graphics/mesh-gradients/images/78.-Night-sky.jpg');
		background-size: 100% 400%;
		display: flex;
		flex-direction: column;
		align-items: center;
	}


	.item .iconfont {
		margin: 30rpx 0 10rpx 0;
		font-size: 50rpx;
		color: #388bd8;
	}

	.title {
		color: #387ece;
		font-size: 28rpx;
		font-weight: bolder;
	}
</style>
